<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实用工具 - 1024导航</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#F59E0B',
                        dark: '#1F2937',
                        light: '#F9FAFB'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-hover {
                @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
            }
            .tool-active {
                @apply bg-primary text-white;
            }
            .text-gradient {
                @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary;
            }
        }
    </style>
</head>

<body class="bg-gray-50 font-sans text-gray-800">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <div class="text-primary text-2xl font-bold">1024<span class="text-secondary">导航</span></div>
                <span class="hidden md:inline-block text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded">v2.3</span>
            </div>

            <nav class="hidden md:flex items-center space-x-6">
                <a href="index.html" class="text-gray-600 hover:text-primary transition-colors">首页</a>
                <a href="resources.html" class="text-gray-600 hover:text-primary transition-colors">资源</a>
                <a href="#" class="text-primary font-medium">工具</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">社区</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">关于</a>
            </nav>

            <div class="flex items-center space-x-3">
                <button
                    class="hidden md:block px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                    <i class="fa fa-user-plus mr-1"></i> 登录
                </button>
                <button class="md:hidden text-gray-600 text-xl">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 搜索区域 -->
    <section class="py-10 bg-gradient-to-b from-white to-gray-50 border-b border-gray-100">
        <div class="container mx-auto px-4">
            <div class="max-w-3xl mx-auto text-center">
                <h1 class="text-[clamp(1.8rem,5vw,2.5rem)] font-bold mb-4 text-gradient">实用工具集合</h1>
                <p class="text-gray-600 mb-8">精选各类在线工具，满足你的日常工作与学习需求</p>

                <div class="relative">
                    <input type="text" placeholder="搜索工具..."
                        class="w-full px-5 py-4 rounded-lg shadow-md border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all">
                    <button
                        class="absolute right-2 top-2 bottom-2 px-5 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                        <i class="fa fa-search mr-1"></i> 搜索
                    </button>
                </div>

                <div class="mt-4 flex flex-wrap justify-center gap-2 text-sm">
                    <span class="text-gray-500">热门工具:</span>
                    <a href="#" class="text-gray-600 hover:text-primary">图片压缩</a>
                    <a href="#" class="text-gray-600 hover:text-primary">PDF转换</a>
                    <a href="#" class="text-gray-600 hover:text-primary">在线翻译</a>
                    <a href="#" class="text-gray-600 hover:text-primary">二维码生成</a>
                    <a href="#" class="text-gray-600 hover:text-primary">JSON格式化</a>
                </div>
            </div>
        </div>
    </section>

    <!-- 工具内容区 -->
    <section class="py-10">
        <div class="container mx-auto px-4">
            <div class="max-w-5xl mx-auto">
                <!-- 工具分类标签 -->
                <div class="flex overflow-x-auto pb-3 mb-8 gap-2 hide-scrollbar">
                    <button class="tool-active whitespace-nowrap px-4 py-2 rounded-full text-sm transition-colors">
                        全部工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-image mr-1"></i> 图片工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-file-text-o mr-1"></i> 文档处理
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-code mr-1"></i> 开发工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-language mr-1"></i> 翻译工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-calculator mr-1"></i> 计算工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-link mr-1"></i> 网络工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-shield mr-1"></i> 安全工具
                    </button>
                    <button
                        class="whitespace-nowrap px-4 py-2 bg-gray-100 text-gray-700 rounded-full text-sm hover:bg-gray-200 transition-colors">
                        <i class="fa fa-other mr-1"></i> 更多工具
                    </button>
                </div>

                <!-- 推荐工具 -->
                <div class="mb-10">
                    <h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
                        <i class="fa fa-star text-accent mr-2"></i> 推荐工具
                    </h2>

                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <!-- 推荐工具1 -->
                        <div class="bg-white rounded-xl shadow-sm overflow-hidden card-hover">
                            <div class="md:flex">
                                <div class="md:w-1/3 bg-blue-50 flex items-center justify-center p-6">
                                    <div
                                        class="w-16 h-16 rounded-full bg-blue-100 flex items-center justify-center text-primary text-2xl">
                                        <i class="fa fa-compress"></i>
                                    </div>
                                </div>
                                <div class="md:w-2/3 p-6">
                                    <div class="flex justify-between items-start mb-2">
                                        <h3 class="font-semibold text-gray-800 text-lg">智能图片压缩工具</h3>
                                        <span
                                            class="text-xs bg-green-100 text-green-800 px-2 py-0.5 rounded-full">热门</span>
                                    </div>
                                    <p class="text-gray-500 text-sm mb-4">高质量压缩图片文件，保持清晰度的同时大幅减小文件大小，支持批量处理和多种格式。</p>
                                    <div class="flex flex-wrap gap-2 mb-4">
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">JPG</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">PNG</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">WebP</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">批量处理</span>
                                    </div>
                                    <button
                                        class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors text-sm">
                                        立即使用
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- 推荐工具2 -->
                        <div class="bg-white rounded-xl shadow-sm overflow-hidden card-hover">
                            <div class="md:flex">
                                <div class="md:w-1/3 bg-purple-50 flex items-center justify-center p-6">
                                    <div
                                        class="w-16 h-16 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 text-2xl">
                                        <i class="fa fa-file-pdf-o"></i>
                                    </div>
                                </div>
                                <div class="md:w-2/3 p-6">
                                    <div class="flex justify-between items-start mb-2">
                                        <h3 class="font-semibold text-gray-800 text-lg">全能PDF工具箱</h3>
                                        <span
                                            class="text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full">新工具</span>
                                    </div>
                                    <p class="text-gray-500 text-sm mb-4">集PDF转换、合并、拆分、压缩、加密等功能于一体，支持多种格式互转，操作简单高效。</p>
                                    <div class="flex flex-wrap gap-2 mb-4">
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">转换</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">合并</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">压缩</span>
                                        <span class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">加密</span>
                                    </div>
                                    <button
                                        class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors text-sm">
                                        立即使用
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 图片工具 -->
                <div class="mb-10">
                    <h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
                        <i class="fa fa-image text-pink-500 mr-2"></i> 图片工具
                    </h2>

                    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
                        <!-- 图片工具1 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-pink-100 flex items-center justify-center text-pink-600 mb-4">
                                <i class="fa fa-crop"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片裁剪工具</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">在线裁剪图片，支持自定义尺寸和比例，简单易用</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 图片工具2 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center text-green-600 mb-4">
                                <i class="fa fa-magic"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片去背景</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">AI智能去除图片背景，精准识别主体，保留细节</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 图片工具3 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mb-4">
                                <i class="fa fa-picture-o"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片格式转换</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">转换图片格式，支持JPG、PNG、WebP等多种格式互转</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 图片工具4 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-amber-100 flex items-center justify-center text-amber-600 mb-4">
                                <i class="fa fa-adjust"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片编辑器</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">在线编辑图片，调整亮度、对比度、饱和度等参数</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 图片工具5 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mb-4">
                                <i class="fa fa-th"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片拼接工具</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">将多张图片拼接成一张，支持横向和纵向拼接</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 图片工具6 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-red-100 flex items-center justify-center text-red-600 mb-4">
                                <i class="fa fa-font"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">图片加水印</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">为图片添加文字或图片水印，保护知识产权</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 文档工具 -->
                <div class="mb-10">
                    <h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
                        <i class="fa fa-file-text-o text-blue-500 mr-2"></i> 文档工具
                    </h2>

                    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
                        <!-- 文档工具1 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mb-4">
                                <i class="fa fa-exchange"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">文档格式转换</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">转换各种文档格式，支持Word、Excel、PPT等格式</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 文档工具2 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center text-green-600 mb-4">
                                <i class="fa fa-file-excel-o"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">在线表格工具</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">在线创建和编辑表格，支持数据统计和图表生成</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 文档工具3 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mb-4">
                                <i class="fa fa-file-word-o"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">在线文档编辑</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">在线编辑文档，支持多人协作和实时保存</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 开发工具 -->
                <div class="mb-10">
                    <h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center">
                        <i class="fa fa-code text-green-500 mr-2"></i> 开发工具
                    </h2>

                    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
                        <!-- 开发工具1 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center text-green-600 mb-4">
                                <i class="fa fa-indent"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">JSON格式化</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">格式化JSON数据，使代码更易读，支持压缩和验证</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 开发工具2 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mb-4">
                                <i class="fa fa-qrcode"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">二维码生成器</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">将文本、网址等信息生成二维码，支持自定义样式</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>

                        <!-- 开发工具3 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 card-hover">
                            <div
                                class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mb-4">
                                <i class="fa fa-lock"></i>
                            </div>
                            <h3 class="font-semibold text-gray-800 mb-2">密码生成器</h3>
                            <p class="text-gray-500 text-sm mb-4 line-clamp-2">生成高强度随机密码，可自定义长度和字符类型</p>
                            <button
                                class="w-full py-2 border border-primary text-primary rounded-md hover:bg-primary/5 transition-colors text-sm">
                                开始使用
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 加载更多 -->
                <div class="text-center mt-8">
                    <button
                        class="px-6 py-2.5 bg-white border border-gray-200 rounded-md text-gray-700 hover:bg-gray-50 transition-colors inline-flex items-center">
                        <i class="fa fa-refresh mr-2"></i> 加载更多工具
                    </button>
                </div>
            </div>
        </div>
    </section>

    <!-- 底部区域 -->
    <footer class="bg-gray-800 text-gray-300 py-10 mt-10">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">1024导航</h3>
                    <p class="text-sm text-gray-400 mb-4">精选互联网优质资源，打造高效便捷的导航平台，助力你的工作与学习。</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-github text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-twitter text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-weixin text-xl"></i>
                        </a>
                    </div>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">快速链接</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="index.html" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                        <li><a href="resources.html" class="text-gray-400 hover:text-white transition-colors">资源分类</a>
                        </li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">实用工具</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">最新收录</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">热门推荐</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">帮助支持</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">资源提交</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">举报不良信息</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">关于我们</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">网站介绍</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用条款</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">免责声明</a></li>
                    </ul>
                </div>
            </div>

            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-sm text-gray-500">
                <p>© 2023 1024导航. 本站资源仅供学习交流使用，如有侵权请联系删除。</p>
            </div>
        </div>
    </footer>

    <!-- 回到顶部按钮 -->
    <button id="backToTop"
        class="fixed bottom-6 right-6 w-12 h-12 rounded-full bg-primary text-white shadow-lg flex items-center justify-center opacity-0 invisible transition-all duration-300">
        <i class="fa fa-arrow-up"></i>
    </button>

    <script>
        // 回到顶部按钮功能
        const backToTopBtn = document.getElementById('backToTop');

        window.addEventListener('scroll', () => {
            if (window.scrollY > 300) {
                backToTopBtn.classList.remove('opacity-0', 'invisible');
                backToTopBtn.classList.add('opacity-100', 'visible');
            } else {
                backToTopBtn.classList.remove('opacity-100', 'visible');
                backToTopBtn.classList.add('opacity-0', 'invisible');
            }

            // 导航栏滚动效果
            const header = document.querySelector('header');
            if (window.scrollY > 50) {
                header.classList.add('py-2', 'shadow');
                header.classList.remove('py-3', 'shadow-sm');
            } else {
                header.classList.add('py-3', 'shadow-sm');
                header.classList.remove('py-2', 'shadow');
            }
        });

        backToTopBtn.addEventListener('click', () => {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });

        // 工具分类切换功能
        const toolCategoryButtons = document.querySelectorAll('.flex.overflow-x-auto button');
        toolCategoryButtons.forEach(button => {
            button.addEventListener('click', () => {
                // 移除所有按钮的活跃状态
                toolCategoryButtons.forEach(btn => {
                    btn.classList.remove('tool-active');
                    btn.classList.add('bg-gray-100', 'text-gray-700', 'hover:bg-gray-200');
                });

                // 为当前点击的按钮添加活跃状态
                button.classList.add('tool-active');
                button.classList.remove('bg-gray-100', 'text-gray-700', 'hover:bg-gray-200');

                // 在实际应用中，这里会根据选择的分类加载相应的工具
                const categoryName = button.textContent.trim();
                console.log(`切换到工具分类: ${categoryName}`);
            });
        });

        // 搜索功能
        const searchInput = document.querySelector('input[placeholder="搜索工具..."]');
        const searchButton = document.querySelector('button:has(.fa-search)');

        function handleSearch() {
            const query = searchInput.value.trim();
            if (query) {
                alert(`搜索工具: ${query}\n在实际应用中，这里会显示搜索结果`);
            } else {
                alert('请输入搜索内容');
            }
        }

        searchButton.addEventListener('click', handleSearch);
        searchInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter') {
                handleSearch();
            }
        });

        // 加载更多功能
        const loadMoreBtn = document.querySelector('button:has(.fa-refresh)');
        loadMoreBtn.addEventListener('click', () => {
            loadMoreBtn.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 加载中...';

            // 模拟加载延迟
            setTimeout(() => {
                loadMoreBtn.innerHTML = '<i class="fa fa-refresh mr-2"></i> 加载更多工具';
                alert('已加载全部工具');
            }, 1500);
        });

        // 工具使用按钮点击效果
        const toolButtons = document.querySelectorAll('button:contains("开始使用"), button:contains("立即使用")');
        toolButtons.forEach(button => {
            button.addEventListener('click', () => {
                const toolName = button.closest('.card-hover, .md\\:flex').querySelector('h3').textContent;
                alert(`正在打开工具: ${toolName}\n在实际应用中，这里会打开相应的工具页面`);
            });
        });
    </script>
</body>

</html>